import * as commentsApi from '@/api/comments';

export default {
  // 向页面暴露
  namespaced: true,
  state: {
    commentsList: [],
  },
  mutations: {
    COMMENTS_LIST(state, newValue) {
      state.commentsList = newValue;
    },
  },
  // 向页面暴露 updateCommentsList  getCommentsList
  actions: {
    async updateCommentsList({ commit }, id) {
      const res = await commentsApi.getCommentsList(id);
      commit('COMMENTS_LIST', res);
      console.log('11', res)
    },
  },
}
